﻿cmake_minimum_required(VERSION 3.14)
#Very importantVery important
add_definitions(-DUNICODE -D_UNICODE)
project(handlers LANGUAGES CXX)
file(GLOB HANDLER_SRC_LIST ./*.cpp ./*.h ./*/*.cpp ./*/*.h ./handler/singletone/*.h)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network)
find_package(Threads REQUIRED)
include_directories(./third_party/)
include_directories(./third_party/breakpad/src)
add_subdirectory(./third_party)

add_library(handlers STATIC ${HANDLER_SRC_LIST})
target_link_libraries(handlers PRIVATE Threads::Threads breakpads)
target_link_libraries(handlers PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network breakpads)
target_compile_definitions(handlers PRIVATE QKDNETS_LIBRARY)
install(TARGETS handlers)
